﻿using UnityEngine;
using UnityEditor;
using System;

public class TypeUtils 
{
    public static string GetNameByT<T>()
    {
        return typeof(T).Name;
    }

    public static string GetNameByT(MyScriptableObject obj)
    {
        return obj.GetType().Name;
    }

    public static string GetZHNameByT<T>()
    {
        return GetZHNameByT(typeof(T));
    }

    public static string GetZHNameByT(MyScriptableObject obj)
    {
        return GetZHNameByT(obj.GetType());
    }

    public static string GetZHNameByT(Type type)
    {
        string name = type.Name;
        if (name== typeof(SkillData).Name)
        {
            return "技能数据";
        }
        if (name == typeof(SkillBulletTriggerData).Name)
        {
            return "子弹配置";
        }
        if (name == typeof(SkillBulletData).Name)
        {
            return "子弹数据";
        }
        if (name == typeof(BulletShapeData).Name)
        {
            return "子弹形状";
        }
        if (name == typeof(BulletSiteTargetData).Name)
        {
            return "子弹位置";
        }
        if (name == typeof(BulletTrailData).Name)
        {
            return "子弹飞行";
        }
        if (name == typeof(BulletTriggerData).Name)
        {
            return "子弹触发";
        }
        if (name == typeof(BulletFinishData).Name)
        {
            return "子弹结束";
        }
        return name;
    }
}